package com.zyht.bank.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.zyht.bank.entity.WxTags;



public interface WxTagsSQLMapper {

	@Update("<script>"
		+ "<foreach collection=\"list\" item=\"item\" index=\"index\" open=\"\" close=\"\" separator=\";\">"
        + " update wx_tags set tag_name=#{item.tagName}, tag_count=#{item.tagCount}, tag_status=#{item.tagStatus} where id = ${item.id}"
        + "</foreach>"      
		+"</script>")
	void updateBatch(@Param("list") List<WxTags> updateList);

	@Insert("<script>"
		+ "insert into wx_tags (tag_id, tag_name, tag_status, tag_count) values "
		+ "<foreach collection =\"list\" item=\"item\" index= \"index\" separator =\",\"> "
		+ "(#{item.tagId,jdbcType=BIGINT}, #{item.tagName,jdbcType=VARCHAR}, #{item.tagStatus,jdbcType=CHAR}, #{item.tagCount,jdbcType=INTEGER})"
		+ "</foreach>"
		+ "</script")
	void insertBatch(@Param("list") List<WxTags> insertList);
	
}
